import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';

class Gettoken with ChangeNotifier{
  String token;
  settoken(token)async{
    SharedPreferences prfes = await SharedPreferences.getInstance();
    prfes.setString('userInfo', token);
    showtoken();
  }

  showtoken()async{
    SharedPreferences prfes = await SharedPreferences.getInstance();
    if (prfes.getString('userInfo') !=null) {
      token = prfes.getString('userInfo');
      notifyListeners();
    }
  }
}